Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

1.6K
Vistas
IntelliJ Kotlin - How do I fix "Ensure that you have a dependency on the Kotlin standard library" in a project?

I've been trying to set up a new Kotlin project in IntelliJ IDEA, using the default IntelliJ Build System (not Gradle) and JDK 15. Whenever it creates the default main.kt file, and I try to build and run the main function, which looks like this:

fun main(args: Array<String>) {
    println("Hello World!")
}

the build fails after a short time with the following errors:

Kotlin: Cannot access built-in declaration 'kotlin.Array'. Ensure that you have a dependency on the Kotlin standard library

Kotlin: Cannot access built-in declaration 'kotlin.String'. Ensure that you have a dependency on the Kotlin standard library

and

Kotlin: Unresolved reference: println

I've tried changing the project SDK to the kotlin SDK, to Java 14 and to Java 1.8. I'm not sure exactly how to add the dependency it asks for. Any help is appreciated.

This is what the dependencies window shows within the project: Module Dependencies

Right now the project is using JDK 15, and Kotlin 1.4.10. I've tried updating the plugin, uninstalling and reinstalling, deactivating and reactivating, all to no avail.

The project files can be found here on Google Drive

over 4 years ago · Santiago Trujillo
3 Respuestas
Responde la pregunta

0

Removing the .idea/library file inside the project directory and then selecting "use library from plugin" when prompted to configure Kotlin files by the IDE solved the problem.

over 4 years ago · Santiago Trujillo Denunciar

0

Please provide more information and check what Kotlin version do you have installed:

  1. Tools > Kotlin > Configure Kotlin Plugin Updates: install the latest version of Kotlin

  2. File > Project Structure > Project: what is your Project SDK there? Choose 15 (something line java version "15.0.1"). If you don't have 15 there, click "+" and add the newest version (unless you need an older version).

over 4 years ago · Santiago Trujillo Denunciar

0

I tried all of the above but eventually found out, that in one project, my SDKs were completely broken after the newest Intellij Update. If you go to Project Structure -> Platform Settings -> SDKs, I had an entry for Kotlin with a non existing path for an Intellij Version of last year. This was definitely not there before and it seems to have messed up the kotlin installation. After i deleted that entry and as described above the libraries as well, it worked again.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda